Method of setting bi-directional offset in a PWM controller using a single programming pin

ABSTRACT

A user-programmable bi-directional, constant current generator circuit allows external programming of either a positive (+) or a negative (-) polarity output current, for injection into one of two locations of the PWM controller circuit of a DC-DC voltage converter. The parameters of the DC-DC converter&#39;s offset voltage will depend upon the connection of a single programming pin to one of two programming resistors. The programming resistors are respectively referenced to different supply rail voltages (VCC and VSS). The polarity of the offset additionally depends upon where, within the PWM-controlled DC-DC converter, the programmed constant current is injected.

FIELD OF THE INVENTION

The present invention relates in general to electronic circuits andcomponents therefor, and is particularly directed to a new and improvedconstant current generator circuit-based arrangement for providing aprogrammable bi-directional voltage offset for a pulse width modulationcontroller (PWM) of a PWM-based DC-DC converter.

BACKGROUND OF THE INVENTION

FIG. 1 diagrammatically illustrates the configuration of a conventionalpulse width modulation (PWM) controlled DC-DC power converter. As showntherein a voltage terminal 10 is coupled to receive a reference voltageV1, such as that supplied by a digital-to-analog converter (DAC). Thisreference voltage is coupled to a reference terminal pin REF through afilter 11, such as that comprised of a resistor R4 and capacitor C3. Thevoltage terminal REF, in turn, is coupled to the non-inverting (+) input21 of an operational amplifier (OP AMP) 20. The output 23 of the OP AMPis coupled to a PWM generator circuit 30, the output 33 of which iscoupled through an inductor (L1) 40 to an output node 50.

The PWM generator circuit's output 33 is fed back as an output VOUT tothe inverting (−) input 22 of amplifier 20 through a filter 60containing a series resistor R2 coupled to a feedback path FB to theoutput 23 of the amplifier 20, and through a series connection of acapacitor Cl and a resistor R1 to a node COMP, that receives anamplified and filtered error signal from the amplifier 20. The PWMgenerator circuit 30 drives a load (represented by a resistor R3)coupled to the output node 50. The COMP terminal controls the PWMgenerator in a direction to minimize the difference between the voltageREF and the voltage VOUT.

PWM-based DC power supply integrated circuits are often required to havea user adjustable offset. Specifically, in some applications it may bedesirable to have the output voltage generated at the output node VOUTdifferent from the input reference voltage V1 by a prescribed (e.g.,user-programmable) offset value. Depending upon the application, it maybe necessary that this offset voltage be bi-directional, and must berepeatable and stable. Generating this offset should require a minimumnumber of external components, should not be dependent on other factorssuch as power supply voltage and, for economy of packaging, shouldrequire the least number of integrated circuit pins. In addition, toalleviate the design of supporting components, the offset should notrequire a stable current reference, but only a stable voltage reference(such as a bandgap voltage reference).

SUMMARY OF THE INVENTION

In accordance with the present invention, these objectives aresuccessively achieved by a constant current generator circuit that isconfigured to allow external programming of either a positive (+) or anegative (−) polarity output current, that is readily injected into oneof two locations of the PWM controller circuit of a DC-DC voltageconverter. As will be described, the parameters of the DC-DC converter'soffset voltage will depend upon the connection of a single programmingpin to one of two programming resistors. The programming resistors arerespectively referenced to different supply rail voltages (VCC and VSS),on the one hand, and will also depend upon where, within thePWM-controlled DC-DC converter, the programmed constant current isinjected.

The user-programmable, bi-directional constant current generatorcontains first and second operational amplifiers that drive associatedcomplementary switching devices (such as PMOSFET and NMOSFET switches).The input of one of the amplifiers is coupled to a first DC voltagereferenced to a first DC power supply rail (e.g., VCC). The input of theother amplifier is coupled to a second DC voltage referenced to anothersupply rail (e.g., VSS or ground). The current flow paths through thetwo switching devices are coupled in series between an offset inputterminal to which a programming input pin is coupled and an offsetcurrent output terminal.

The first programming resistor is coupled between the VCC supply railand a first programming pin; the second programming resistor is coupledbetween the VSS supply rail and a second programming pin. By selectivelyconnecting the programming input pin to one of the first and secondprogramming pins (and thereby to their associated resistors), thebi-directional constant current generator is user-programmed to supplyone of a positive polarity and negative polarity offset current to theoffset current output terminal.

In a first, ‘sourcing’ current programming mode, the first programmingpin is coupled to the programming input pin, while the secondprogramming pin is open. As a result, that one of the amplifiers whichis coupled to the first programming resistor, will cause its associatedswitching device to conduct. With its associate switching deviceconducting, that amplifier attempts to drive the voltage at its inputport to match that amplifier's reference voltage. At the same time, theother amplifier maintains its associated switching device in the offstate. With the one amplifiers' switching device turned on, a sourcingcurrent will flow from the supply rail through the first programmingresistor, the single programming terminal and the current path of theturned-on switch to the current source's output terminal. The magnitudeof this current is effectively equal to the reference voltage divided byits associated series resistor.

In a second, ‘sinking’ current programming mode, the second programmingpin is coupled to the programming input pin, while the first programmingpin is open. As a result, the second amplifier will cause its associatedswitching device to conduct, while the one amplifier maintains itsswitching device in the off state. The second amplifier attempts to makevoltage at the input port match that amplifier's reference voltage. Withthe second amplifiers' switching device turned on, a sinking currentwill flow from a supply rail through the second programming resistor,the single programming terminal and the current flow path of the secondamplifier's associated turned-on switch to the output terminal. Themagnitude of the sinking current is effectively equal to the referencevoltage divider by its associated series resistor.

A selected one of these ‘sourcing’ and ‘sinking’ currents as generatedby the user-programmable, bi-directional constant current generator ofthe invention is connectable to either of two locations in the PWMcontroller of the PWM switching DC power supply to provide a constantoffset voltage. The reference voltages employed within the constantcurrent source may be based upon a bandgap voltage (referenced to VSS orground (GND)). In a non-limiting, but preferred embodiment, the firstreference voltage (referenced to VCC) may be derived from the secondvoltage (referenced to VSS)

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 diagrammatically illustrates the configuration of a conventionalpulse width modulated (PWM) switching DC power supply;

FIG. 2 diagrammatically shows an embodiment of a singlepin-programmable, bi-directional offset generator circuit in accordancewith the invention;

FIG. 3 illustrates a first implementation of interconnecting the singlepin-programmable, bi-directional offset generator circuit of FIG. 2 withthe PWM switching DC power supply of FIG. 1; and

FIG. 4 a second implementation of interconnecting the singlepin-programmable, bi-directional offset generator circuit of FIG. 2 withthe PWM switching DC power supply of FIG. 1;

FIG. 5 shows a Table associating the polarity of the offset voltage forthe choice of programmable parameters of the single pin-programmable,bi-directional offset generator circuit of FIG. 2 and itsinterconnections to the PWM switching DC power supply of FIGS. 3 and 4;and

FIG. 6 diagrammatically illustrates non-limiting embodiment of a circuitfor deriving the respective reference voltages V2 and V3 used in thesingle pin-programmable, bi-directional offset generator circuit of FIG.2.

DETAILED DESCRIPTION

Before describing the programmable bi-directional voltage offsetgenerator circuit in accordance with the invention, it should beobserved that the invention resides primarily in an arrangement ofconventional DC power supply circuits and control components therefor,and the manner in which they are integrated together. It is to beunderstood that the invention may be embodied in a variety ofimplementations, and should not be construed as being limited to onlythose shown and described herein. For example, although the non-limitingcircuit implementations of the Figures shows the use of MOSFET devicesto perform controlled switching operations, it will be appreciated thatthe invention is not limited thereto, but also may be configured ofalternative equivalent circuit devices, such as, bipolar transistors.The implementation example to be described is intended to furnish onlythose specifics that are pertinent to the present invention, so as notto obscure the disclosure with details that are readily apparent to oneskilled in the art having the benefit of present description. Throughoutthe text and drawings like numbers refer to like parts.

Attention is now directed to FIG. 2, which diagrammatically shows anembodiment of a single pin-programmable, bi-directional offset generatorcircuit in accordance with the invention, and being configured to bereadily interfaced with the PWM controller of a DC-DC converter of thetype shown in FIG. 1, described above. As shown in FIG. 2, the offsetgenerator comprises a bi-directional constant current generator,containing first and second complementary polarity-based amplifiers 210and 220, respectively. The first or upper amplifier 210 has itsnon-inverting (+) input 211 referenced via a first voltage V2 to anupper voltage (VCC) rail, and its output 213 coupled as a switch-controlinput to the gate of a first output switching device, shown as PMOSFETQ1. In a complementary manner, the second or lower amplifier 220 has itsnon-inverting (+) input 221 referenced via a second DC voltage V3 to alower voltage (VSS) rail, and its output 223 coupled as a switch-controlinput to the gate of a second output switching device, shown as NMOSFETQ2.

MOSFETs Q1 and Q2 have their source-drain paths coupled in seriesbetween a user-programmable offset input terminal OFS and an offsetoutput terminal OFSOUT. A first, programming resistor R5 is coupledbetween the upper (VCC) supply rail and a first programming pin P1,while a second programming resistor R6 is coupled between the lower(VSS) supply rail and a second programming pin P2. As will be described,by selectively connecting programming pin, Pprog to which the inputterminal OFS is connected, to one of the first and second programmingpins P1 and P2, the bi-directional constant current generator is userprogrammed to supply either a positive polarity or a negative polarityoffset current to the OFSOUT terminal.

The OFS terminal is coupled to the respective inverting (−) inputs 212and 222 of respective amplifiers 210 and 220, and also to the sourceS_(Q1) of PMOSEET Q1 and to the source S_(Q2) of NMOSFET Q2. The OFSOUTterminal is coupled to the commonly connected drains D_(Q1) and D_(Q2)of MOSFETS Q1 and Q2. It should be noted that the source and drainconnections of the MOSFETs may be interchanged. The body of PMOSFET Q1is coupled to VCC and the body of NMOSFET Q2 is coupled to VSS to avoidparasitic conduction paths.

The operational parameters of the circuit of FIG. 2 are as follows. Thevalues of the DC voltages V2 and V3 are constrained such that thevoltage VA applied to the non-inverting (+) input 211 of amplifier 210is higher than voltage VB at the non-inverting (+) input 221 ofamplifier 220. Also, the voltage VA must be higher than the voltage atthe output terminal OFSOUT, when resistor R5 is used (the OFS terminalis coupled to programming pin P1) and the voltage VB must be lower thanthe voltage at the output OFSOUT when the resistor R6 is used (the OFSterminal is coupled to programming pin P1).

In operation, in a first, ‘sourcing’ current programming mode, in whichthe programming pin Prog is connected to pin P1, resistor R5 isconnected between VCC and terminal OFS, while pin P2 remains open. Withthis connection, the output 213 of amplifier 210 will drive the gate ofPMOSFET Q1 low causing PMOSFET Q1 to conduct. With MOSFET Q1 conducting,amplifier 210 attdempts to drive the voltage terminal OFS at itsinverting (−) input terminal 212 so as to match the voltage VA at itsnon-inverting (+) input terminal 211. With PMOSFET Q1 being turned on byamplifier 210, a sourcing current will flow from the supply rail VCCthrough resistor R5, terminal OFS, the source-drain path of PMOSFET Q1to the output terminal OFSOUT. The magnitude of this current I_(OFSOUT)is V2/R5.

With terminal OFS driven to equal the voltage VA, and with the voltageVA constrained to be higher than VB, then the voltage at the inverting(−) input 222 of amplifier 220 is higher than at the non-inverting (+)input 221. Amplifier 220 will then drive its output 223, the gate ofMOSFET Q2, low, shutting MOSFET Q2 off. The current from OFSOUT istherefore defined exclusively by V2/R5.

In a second, ‘sinking’ current programming mode, in which programmingpin Prog is connected in pin P2, resistor R6 is connected between VSSand terminal OFS, while pin P1 is open. With this connection, the output223 of amplifier 220 will drive the gate of NMOSFET Q2 high, causingNMOSFET Q2 to conduct. In this condition amplifier 220 attempts to drivethe voltage terminal OFS at its inverting (−) input terminal 222 so asto match the voltage VA at its non-inverting (+) input terminal 211.With NMOSFET Q2 being turned on by amplifier 220, a sinking current willflow from the supply rail VSS through resistor R6, terminal OFS, thesource-drain path of NMOSFET Q2 to the output terminal OFSOUT. Themagnitude of this current I_(OFSOUT) is equal to V3/R6.

With terminal OFS driven to equal the voltage VB, and with the voltageVB constrained to be lower than the voltage VA, then the inverting (−)input 212 of amplifier 210 is lower than the non-inverting (+) input211. Amplifier 210 will then drive its output 210, the fate of PMOSFETQ1, high, shutting MOSFET Q1 off. The current from OFSOUT is thereforedefined exclusively by V3/R6.

The sourcing or sinking current generated by the constant currentgenerator of FIG. 2 can be connected to the PWM controller of the PWMswitching DC power supply of FIG. 1 to provide a constant offsetvoltage. FIG. 3 illustrates one implementation of interconnecting thetwo circuits, wherein the OFSOUT terminal of the constant currentgenerator of FIG. 2 is coupled to the feedback path FB of the PWMswitching DC power supply of FIG. 1. The injection of this constant(source or sinking) current creates an associated voltage drop acrossthe resistor R2 in the PWM-based DC-DC power supply of FIG. 1, therebyshifting the voltage VOUT by a value corresponding to the product of theresistance of resistor R2 and the current I_(OFSOUT) injected atterminal FB.

If the direction of current flow is out of the output pin OFSOUT, theresulting voltage drop V_(R5) across resistor R5 will make the voltageat point FB higher than at VOUT. In response to this voltage increase atits inverting (−) input terminal 222, amplifier 220 will reduce itsoutput voltage and thereby the voltage VOUT, so as to bring the voltageat FB back into balance with the voltage at REF. Conversely, if thedirection of current flow is into the output pin OFSOUT, the resultingvoltage drop V_(R5) across resistor R5 will make the voltage at point FBlower than at VOUT. In response to this voltage decrease at itsinverting (−) input terminal 222, amplifier 220 will increase its outputvoltage and thereby the voltage VOUT, so as to bring the voltage at FBback into balance with the voltage at REF.

It should be noted that the difference or offset voltage between thevoltages at FB and VOUT is equal to the product of the value of resistorR2 times the output current I_(OFSOUT). Also, I_(OFSOUT) is equal toV2/R5 or V3/R6. The magnitude of the offset voltage is therefore equalto V2XR2/R5 or V3XR2/R6. In a typical PWM controller integrated circuit,the voltages V1, V2 and V3 are internally generated and stable, whileresistors R2, R5, and R6 are stable external components.

A second implementation of interconnecting the circuits of FIGS. 1 and 2is shown in FIG. 4, wherein the OFSOUT terminal of the constant currentgenerator of FIG. 2 is coupled to the reference terminal pin REF of thePWM switching DC power supply of FIG. 1. The injection of the constant(source or sinking) current I_(OFSOUT) creates an associated voltagedrop across the input resistor R4 in the PWM-based DC-DC power supply ofFIG. 1, as the current I_(OFSOUT) must flow through resistor R4 toreference voltage V1, as there is no other DC path available (capacitorC3 blocks the path to VSS, while the input to amplifier 20 is highimpedance).

In the embodiment of FIG. 4, the current I_(OFSOUT) will create avoltage drop across the resistor R4 of the PWM-controlled DC-DCconverter of FIG. 1, causing the DC voltage at terminal REF to bedifferent from the DC voltage of reference voltage V1. If the I_(OFSOUT)flows out of terminal OFSOUT, the voltage at terminal REF will be higherthan the voltage V1, increasing the voltage applied to the non-inverting(+) input 21 of amplifier 20. In response to this voltage increase,amplifier 20 increases the voltage at terminal VOUT to make the voltageat FB match the voltage at REF.

On the other hand, if the current I_(OFSOUT) flows into terminal OFSOUT,the voltage at terminal REF will be lower than the voltage V1,decreasing the voltage applied to the non-inverting (+) input 21 ofamplifier 20. In response to this voltage drop, amplifier 20 willdecrease the voltage at terminal VOUT to make the voltage at FB matchthe voltage at REF. The offset or difference voltage between the voltageV1 and the voltage at REF is equal to the product of the currentI_(OFSOUT) times the value of the resistor R4. Also, the currentI_(OFSOUT) is equal to V2/R5 or V3/R6. The value of the offset voltageis therefore equal to V2XR4/R5 or V3XR4/R6.

From the above description, it will be appreciated that the polarity ofthe offset voltage, namely the polarity of VOUT referenced to V1, isdependent upon the choice of the programming resistor (either R5 or R6)of the constant current generator of FIG. 2, and also the pin of FIG. 1to which the OFSOUT of FIG. 2 is connected (either FB or REF). Thepolarity of the offset voltage for the choice of these programmableparameters is shown in the Table of FIG. 5.

The voltage V3 of the constant current source of FIG. 2 may typically beimplemented as a bandgap voltage (referenced to VSS or ground (GND)).The voltage V2, referenced to VCC, may be derived from the voltage V3. Anon-limiting embodiment of a circuit for deriving the voltage V2 fromthe (bandgap-based) voltage V3 is shown in FIG. 6, as comprising anoperational amplifier 250 having its non-inverting (+) input 251 coupledto the positive side of voltage source V3.

Amplifier 250 has its output 253 coupled to drive the gate of NMOSFETQ3. NMOSFET Q3 has its source-drain path, coupled in series with a firstresistor R7 to the Vss supply rail and a second resistor R8 coupled tothe VCC supply rail. The voltage V2 is derived across resistor R8. Theconnection between the source/drain of PMOSFET Q3 and resistor R7 iscoupled to the inverting (−) terminal 252 of amplifier 250. Inoperation, amplifier 250 drives PMOSFET Q3 to make the voltage drop VR7across resistor R7 equal to the voltage V3. This produces a currentequal to V3/R7, which is applied to resistor R8, producing a voltage V2equal to (V3*R8)/R7.

As will be appreciated from the foregoing description, the singlepin-programmable, bi-directional offset generator circuit of the presentinvention readily enables a PWM-based DC power supply circuit tosupplied with a user selectable positive or negative polarity outputcurrent. Depending upon the (single pin) programming of the currentgenerator and the point of injection of its output current into the PWMcontroller circuit, the DC-DC converter will operate at predeterminedoffset voltage.

While I have shown and described several embodiments in accordance withthe present invention, it is to be understood that the same is notlimited thereto but is susceptible to numerous changes and modificationsas known to a person skilled in the art, and I therefore do not wish tobe limited to the details shown and described herein, but intend tocover all such changes and modifications as are obvious to one ofordinary skill in the art.

What is claimed is:
 1. An apparatus for generating a regulated directcurrent (DC) voltage comprising: a DC-DC converter operative to generatea regulated DC output voltage derived from a supply voltage, said DC-DCconverter having a pulse width modulation (PWM) generator whichgenerates a PWM-based output voltage at an output node thereof, saidoutput voltage being coupled through an inductor element to an outputvoltage terminal for application to a load; a PWM controller forcontrolling the operation of said PWM generator, said PWM controllerincluding an operational amplifier having a first input coupled toreceive a reference voltage, a second input, and an output coupled tosaid PWM generator, and a current feedback resistor coupled between saidoutput node and said second input of said operational amplifier; and auser-programmable bi-directional, constant current generator circuit forcontrolling the operation of said PWM controller, and being configuredto generate a user-programmable one of a positive (+) or a negative (−)polarity current, and to supply said a user-programmable current to auser-selected location of said PWM controller for controlling theoperation of said PWM generator.
 2. The apparatus according to claim 1,wherein said user-programmable bi-directional, constant currentgenerator circuit comprises first and second operational amplifiers thatdrive associated switching devices, said first operational amplifier iscoupled receive a first DC voltage referenced to a first DC power supplyrail, and said second operational amplifier is coupled to receive asecond DC voltage referenced to a second DC supply rail, current flowpaths through said switching devices are coupled in series between anoffset input terminal, to which a programming input pin is coupled andan offset current output terminal from which said user-programmable oneof a positive (+) or a negative (−) polarity current is derived, andsaid programming input pin is coupled through a selected one of a firstprogramming resistor to said first DC voltage supply rail, and a secondprogramming resistor to said second DC voltage supply rail.
 3. Theapparatus according to claim 2, wherein, for either a current-sourcingor a current-sinking mode, said programming input pin is coupled throughsaid first programming resistor to said first DC voltage supply rail,causing said first operational amplifier to drive its switching deviceto conduct, so that said first operational amplifier attempts to makethe voltage at its input match said first reference voltage, while saidsecond operational amplifier maintains said second switching device inthe off state, whereby a current will flow between said first DC supplyrail through said first programming resistor, said input programmingterminal and the current path of the turned-on first switching device,said offset current output terminal and said user-selected location ofsaid PWM controller.
 4. The apparatus according to claim 3, wherein forsaid current-sourcing mode, said user-selected location of said PWMcontroller to which said offset current output terminal is appliedcorresponds to said first input of said operational amplifier of saidPWM controller.
 5. The apparatus according to claim 3, wherein for saidcurrent-sinking mode, said user-selected location of said PWM controllerto which said offset current output terminal is applied corresponds tosaid second input of said operational amplifier of said PWM controller.6. The apparatus according to claim 2, wherein, for either acurrent-sourcing or a current-sinking mode, said programming input pinis coupled through said second programming resistor to said second DCvoltage supply rail, causing said second operational amplifier to driveits switching device to conduct, so that said second operationalamplifier attempts to make the voltage at its input match said secondreference voltage, while said first operational amplifier maintains saidfirst switching device in the off state, whereby a current will flowbetween said second supply rail through said second programmingresistor, said input programming terminal and the current path of theturned-on second switching device, said offset current output terminaland said user-selected location of said PWM controller.
 7. The apparatusaccording to claim 6, wherein for said current-sourcing mode, saiduser-selected location of said PWM controller to which said offsetcurrent output terminal is applied corresponds to said second input ofsaid operational amplifier of said PWM controller.
 8. The apparatusaccording to claim 6, wherein for said current-sinking mode, saiduser-selected location of said PWM controller to which said offsetcurrent output terminal is applied corresponds to said first input ofsaid operational amplifier of said PWM controller.
 9. The apparatusaccording to claim 2, further including a bandgap voltage generatorcircuit that is operative to generate said first and second DC voltagesfor application to said first and second operational amplifiers,respectively.
 10. A method of generating a regulated direct current (DC)voltage, comprising the steps of: (a) providing a DC-DC convertercontrolled by a pulse width modulation (PWM) generator which generates aPWM based output voltage at an output node thereof that is coupledthrough an inductor element to an output voltage terminal forapplication to a load; and (b) controlling the operation of said PWMgenerator by performing the steps of: 1- providing an operationalamplifier having a first input coupled to receive a voltage reference, asecond input and an output coupled to said PWM generator, 2- coupling acurrent feedback resistor between said output node and said second inputof said operational amplifier, 3- generating a user-programmable one ofa positive (+) or a negative (−) polarity constant current, and 4-supplying said user-programmable one of a positive (+) or a negative (−)polarity constant current to a user-selected location of said PWMgenerator.
 11. The method according to claim 10, wherein step (b)3comprises: providing first and second operational amplifiers that driveassociated switching devices, said first operational amplifier beingcoupled to receive a first DC voltage referenced to a first DC powersupply rail, and said second operational amplifier being coupled toreceive a second DC voltage referenced to a second DC supply rail,current flow paths through said switching devices being coupled inseries between an offset input terminal, to which a programming inputpin is coupled, and an offset current output terminal from which saiduser-programmable one of a positive (+) or a negative (−) polaritycurrent is derived, and wherein said programming input pin is coupledthrough a selected one of a first programming resistor to said first DCvoltage supply rail and a second programming resistor to said second DCvoltage supply rail.
 12. The method according to claim 11, wherein, instep (b)4, for either a current-sourcing or a current-sinking mode, saidprogramming input pin is coupled through said first programming resistorto said first DC voltage supply rail, causing said first operationalamplifier to drive its switching device to conduct, so that said firstoperational amplifier attempts to make the voltage at its input matchsaid first reference voltage, while said second operational amplifiermaintains said second switching device in the off state, whereby acurrent flows between said first DC supply rail through said firstprogramming resistor, said input programming terminal and the currentpath of the turned-on first switching device, said offset current outputterminal and said user-selected location of said PWM controller.
 13. Themethod according to claim 12, wherein step (b)4 corresponds to saidcurrent-sourcing mode, and wherein said user-selected location of saidPWM controller to which said offset current output terminal is appliedcorresponds to said first input of said operational amplifier of saidPWM controller.
 14. The method according to claim 12, wherein step (b)4corresponds to current-sinking mode, and wherein said user-selectedlocation of said PWM controller to which said offset current outputterminal is applied corresponds to said second input of said operationalamplifier of said PWM controller.
 15. The method according to claim 11,wherein, in step (b)4, for either a current-sourcing or current-sinking'mode, said programming input pin is coupled through said secondprogramming resistor to said second DC voltage supply rail, causing saidsecond operational amplifier to drive its switching device to conduct,so that said second operational amplifier attempts to make the voltageat its input match said second reference voltage, while said firstoperational amplifier maintains said first switching device in the offstate, whereby a current will flow between said second supply railthrough said second programming resistor, said input programmingterminal and the current path of the turned-on second switching device,said offset current output terminal and said user-selected location ofsaid PWM controller.
 16. The method according to claim 15, wherein step(b)4 corresponds to current-sourcing mode, and wherein saiduser-selected location of said PWM controller to which said offsetcurrent output terminal is applied corresponds to said second input ofsaid operational amplifier of said PWM controller.
 17. The methodaccording to claim 15, wherein step (b)4 corresponds to current-sinkingmode, and wherein said user-selected location of said PWM controller towhich said offset current output terminal is applied corresponds to saidfirst input of said operational amplifier of said PWM controller. 18.The method according to claim 11, wherein step (b)3 includes generatingsaid first and second DC voltages from a bandgap voltage generatorcircuit.
 19. A user-programmable constant current generator circuitcomprising: an input terminal; an output terminal from which auser-programmable constant current is derived; a first operationalamplifier having a first input coupled to receive a first DC voltagereferenced to a first power supply rail, a second input, and an outputcoupled to drive an associated first switching device; a secondoperational amplifier having a first input coupled to receive a secondDC voltage referenced to a first power supply rail, a second input, andan output coupled to drive an associated second switching device; saidfirst and second switching devices having current flow pathstherethrough coupled between said input terminal and said outputterminal; and a first programming resistor coupling said input terminalto one of said first and second power supply rails.
 20. Theuser-programmable constant current generator circuit according to claim19, further including a bandgap voltage generator circuit that isoperative to generate said first and second DC voltages for applicationto said first and second operational amplifiers, respectively.